<?php


namespace App\Http\Controllers;


use App\Events\Test;
use App\Jobs\TestJob;
use App\Models\TestRegion;

class UserController extends Controller
{
    /**
     * showdoc
     * @catalog 测试文档/用户相关
     * @title 用户登录
     * @description 用户登录的接口
     * @method get
     * @url https://www.showdoc.cc/home/user/login
     * @header token 可选 string 设备token
     * @param username 必选 string 用户名
     * @param password 必选 string 密码
     * @param name 可选 string 用户昵称
     * @return {"error_code":0,"data":{"uid":"1","username":"12154545","name":"吴系挂","groupid":2,"reg_time":"1436864169","last_login_time":"0"}}
     * @return_param groupid int 用户组id
     * @return_param name string 用户昵称
     * @remark 这里是备注信息
     */
    public function test()
    {

        $region = TestRegion::findOrFail(1);
//        event(new Test($region));

        TestJob::dispatch($region)->delay(now()->addSecond(10));
        return res();
    }
}
